package com.jxb.lession78.web.servlet;

import com.alibaba.fastjson.JSON;
import com.jxb.lession78.common.Constant;
import com.jxb.lession78.entity.Dept;
import com.jxb.lession78.services.DeptServices;
import com.jxb.lession78.services.impl.DeptServicesImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@WebServlet("/dept")
public class DeptController extends BaseController {
    private DeptServices ds = new DeptServicesImpl();

    public String getAll(HttpServletRequest req, HttpServletResponse resp){
        List<Dept> list = ds.getAll();
        String json = JSON.toJSONString(list);
        return json;
    }
}
